(Clock seat periphery using a subroutine)
(20th January 2014)
(MEW)
(for Mach3)
()
(Machines the periphery)
()
()
(Set X0 Y0 at the left front corner)
(Set Z0 at the top surface of the work)
(Safe Z is clear of the work and all obstacles at Z20. Adjust as necessary if you are using a different setup to the one shown in MEW)
()
(Tool is an 18mm dia router bit)
()
(Program sets speed to 3000rpm, which is slower than optimum for an 18mm router bit cutting wood or MDF)
()
()
(------------------ Main Program ---------------)
()
()
(Initialisation sequence)
G17 (use the XY plane)
G21 (Set the units to mm)
G40 (Cancel cutter compensation)
G49 (Cancel tool length offsets)
G54 (Use co-ordinate system 1)
G61 (Exact path mode)
G80 (cancel canned cycle mode)
G90 (Use absolute distances)
G91.1 (Use incremental distances for arcs)
G92.1 (Cancel co-ordinate system offsets)
G94 (Set feed per minute mode)
G98 (Set the canned cycle retract behaviour)
()
()
F200
S3000
M3
()
()
G0 Z20 (Safe Z)
()
()
(Position the cutter clear of the work at X-10 Y9)
G0 X-10 Y-9
(Set the depth of cut)
G0 Z-10
(Call the subroutine to cut around the periphery)
M98 P100
(Take a deeper cut to finish to depth)
(allowing cutter to protrude 2mm below the bottom face of the material)
G0 Z-20
(Call the subroutine to cut around the periphery)
M98 P100
()
(Go to first hole centre, then machine pocket)
G0 X58 Y30
M98 P123
(G0 to second hole centre, then machine pocket)
G0 X162 Y30
M98 P123
()
G0 Z20 (Safe Z)
G0 X0 Y0
M30
()
()
(------------------Subroutine definitions------------------)
()
()
O100 (Take a cut around the periphery)
(Entry assumes CP is at X-10 Y-9)
(Exits with X-10 Y-9)
G1 X229 Y-9
G1 X229 Y99
G1 X181 Y99
G1 X181 Y65
G2 X175 Y59 I-6 J0
G1 X45 Y59
G2 X39 Y65 I0 J6
G1 X39 Y99
G1 X-9 Y99
G1 X-9 Y-9
G0 X-10 Y-9
M99
()
()
O123 (Subroutine to machine pocket)
(Entry assumes CP is at centre of hole)
(Exits with CP at centre of hole, with original co-ordinates)
G92 X0 Y0 (Temporary offset to make X0 Y0)
G0 X0 Y0 Z1
G0 X2 Y0 Z0.1
G2 X2 Y0 I-2 J0 Z-2
G2 X2 Y0 I-2 J0 Z-4
G2 X2 Y0 I-2 J0 Z-6
G2 X2 Y0 I-2 J0 Z-8
G2 X2 Y0 I-2 J0 Z-8
G0 Z20
G92.1 (Remove offset to restore original co-ordinates)
M99

